package com.koicarp.agent.example.chatmodel;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.ollama.OllamaChatModel;

/**
 * @Author: liuxia
 * @CreateTime: 2025/9/12 下午9:40
 * @Description:  快速启动test
 */
public class OllamaChatQuickStartTest {

    public static void main(String[] args) {
        String modelName = "deepseek-r1:7b";          // 填入你刚刚下载的模型
        String baseUrl = "http://localhost:11434";     // ollama启动后的ip:port
        ChatModel model = OllamaChatModel.builder()
                .baseUrl(baseUrl)
                .modelName(modelName)
                .build();
        String answer = model.chat("hello world");
        System.out.println("ai答：" + answer);
        // 恭喜你成功完成了一次大模型的调用
    }
}
